using Geek.Server.App.Logic.WebServer;

namespace Server.Logic.WebServer
{
    public static class RoleBriefExtensions
    {
        /// <summary>
        /// 检测数据是否有效
        /// </summary>
        public static bool IsValid(this AccountRoleInfo info)
        {
            if (info == null)
                return false;

            if (info.Id == 0)
                return false;

            if (string.IsNullOrEmpty(info.Name))
                return false;
            
            if (info.CreateTime == default)
                return false;
            
            if (info.LastLoginTime == default)
                return false;
            
            return true;
        }
    }
}